import { ApiCall } from "tsrpc";
import { ReqUserInfo, ResUserInfo } from "../../../../tsrpc/shared/protocols/hall/admin/PtlUserInfo";
import { account } from "../../../../module/account/Account";

export default async function (call: ApiCall<ReqUserInfo, ResUserInfo>) {
    // TODO
    if (call.req.__ssoToken) {
        var dUser = account.parseSSO(call.req.__ssoToken);
        if (dUser) call.succ({ user: dUser });
    }
    else {
        call.error("登录令牌不存在");
    }
}